//表单查询 不建议使用
function datagridSearch(table,sfm){
	 if(arguments.length>2){
		 $("#"+table).datagrid('options').queryParams = eval('('+ arguments[2] + ')');
	 }else{
		 $("#"+table).datagrid('options').queryParams = getParamValues(sfm);//paramValue(sfm);
	 }
	$('#'+table).datagrid('loadData', {
		total : 0,
		rows : []
	});
	$('#'+table).datagrid({
		queryParams: $("#"+table).datagrid('options').queryParams, 
		//pagination : true,
		method:'POST'
	});
}

//重置（不建议使用）
function resetPage(table,fm) {
	$('#' + fm).form('clear');
	//document.getElementById(fm).reset();
	//window.location.reload();
	$('#'+table).datagrid({
		queryParams: {}
	});
}

/*function resetForm(fm) {
    //document.getElementById(fm).reset();
    $('#' + fm).form('clear');
    try {
        eval('oasisResetFormCallBack()');
    } catch (e) {
    }
}*/

//重置不刷新dataGrid
function resetPageNoRefresh(fm) {
	document.getElementById(fm).reset();
}

//将[[key,value],[key,value]...]转换为json对象
function toJsonObject(arr) {
    var res = "{";
    for (var i = 0; i < arr.length; i++) {
        var obj = arr[i];
        res += "'" + obj[0] + "':'" + obj[1] + "'";
        if (i < (arr.length - 1)) {
            res += ","
        }
    }
    res += "}";
    //console.info(res);
    var res_json = eval("(" + res + ")");
    return res_json;
}



function formatTodo(value, rowData, rowIndex) {
    return '<a href="#' + rowData['tId'] + '">修改</a>&nbsp;|&nbsp;<a onclick="" href="#'
        + rowData['tId'] + '">删除</a>';
}

function initTable(table, sfm) {
    var pg = $("#" + table).datagrid("getPager");
    if (pg) {
        $(pg).pagination(
            {

                pageSize: 10,// 每页显示的记录条数，默认为10
                // pageList: [5,10,15],//可以设置每页记录条数的列表

                onBeforeRefresh: function () {
                },
                onRefresh: function (pageNumber, pageSize) {
                },
                onChangePageSize: function () {
                },
                onSelectPage: function (pageNumber, pageSize) {

                    $('#' + table).datagrid('loadData', {
                        total: 0,
                        rows: []
                    });

                    $('#' + table).datagrid(
                        {
                            queryParams: $("#" + table).datagrid(
                                'options').queryParams,
                        });

                }

            });
    }

    datagridSearch(table, sfm);
}
/********************************** 查询js重构开始      ****************************************************/
//报表查询的方法
function doReportSearch(paramsReport){
	//逻辑打散2016-01-06  测试一段时间没问题后，删除这部分代码 注意groupId的替换
//	var tabs=$("#oasisReportTabs").tabs("getSelected");
//	var groupId=tabs.attr('id');
//	var sqlId = $("input:radio[name='group_radio"+groupId+"']:checked").attr('sqlId');
//	var selectType=$("input:radio[name='group_radio"+groupId+"']:checked").attr('groupFieldType');
//	if('N'==selectType){
//		$("#datagrid_toolbar_"+groupId+" label").each(
//				function(){
//					if($(this).hasClass('select')){
//						$(this).addClass("hidden");
//					}
//				}
//		);
//	}
//	var columns = $("input:radio[name='group_radio"+groupId+"']:checked").attr('oasisOption');
//	var groupFiledId=$("#"+groupId+"_select").combobox("getValue");
//	columns=eval('('+columns+')');
//	//alert("sqlId:"+sqlId+";;");
//	var paramsReport={};
//	paramsReport['id']=$("#fileId").val();
//	paramsReport['groupId']=groupId;
//	paramsReport['sqlId']=sqlId;
//	paramsReport['groupFiledId']=groupFiledId;
	var defaultPageSize = 500;
	var defaultPageList = [100,500,1000];
	if(typeof DEFINED_DATAGRID_PAGESIZE != "undefined"){
		defaultPageSize = DEFINED_DATAGRID_PAGESIZE;
	}
	if(typeof DEFINED_DATAGRID_PAGE_LIST != "undefined"){
		defaultPageList = DEFINED_DATAGRID_PAGE_LIST;
	}
	var options={
			url:BASE_PATH+'/reportController/getDatas',
			tableId:"combinationDigger_grid_"+paramsReport['groupId'],
			frozenColumns:[paramsReport['frozenColumns']],
			columns:[paramsReport['columns']],
			'pageSize':defaultPageSize,
			'pageList':defaultPageList,
			'sortName':'',
			'sortOrder':'',
			rowStyler:function(index,row){
				if(paramsReport['rowStyler']){
					try{
						var callbackParams={'index':index,'row':row};
						return eval(paramsReport['rowStyler']+'('+JSON.stringify(callbackParams)+')');
					}catch(e){
						
					}
				}
			},
			onClickRow:function(index,row){
				//单击行事件
				if(typeof onClickRow == "function"){
					onClickRow.call(onClickRow,index,row);
				}
			},
			onBeforeLoad:function(param){
				$("#combinationDigger_grid_"+paramsReport['groupId']).datagrid("reloadFooter",[]);
				return true;
			},
			onLoadSuccess:function(data){
				//alert("元素数据类型；"+data.total);
				//alert('报表返回结果下拉列表值是：'+JSON.stringify(data.datas));
				if(data.datas){
					$("#datagrid_toolbar_"+paramsReport['groupId']+" label").removeClass("hidden");
					//alert('id是：'+"#"+groupId+"_select");
					$("#"+paramsReport['groupId']+"_select").combobox({
						valueField:'id',
						textField:'chinese',
						data:data.datas,
						onSelect:function(){
							searchDataByForm();
						}
					});
					//修复不同维度选项不同导致无法选中下拉框数据问题（20160713 xuzhen）
					if(data.groupFiledId){
						var dLen = data.datas.length;
						var has = false;
						for(var i = 0; i < dLen; i++ ){
							if(data.datas[i].id == data.groupFiledId){
								has = true;
								break;
							}
						}
						if(has){
							$("#"+paramsReport['groupId']+"_select").combobox("setValue",data.groupFiledId);
						}else if(data.datas.length > 0){
							$("#"+paramsReport['groupId']+"_select").combobox("setValue",data.datas[0].id);
						}else{
							$("#"+paramsReport['groupId']+"_select").combobox("clear");
						}
					}else if(data.datas.length > 0){
						$("#"+paramsReport['groupId']+"_select").combobox("setValue",data.datas[0].id);
					}else{
						$("#"+paramsReport['groupId']+"_select").combobox("clear");
					}
				}
				
				if(data.total>0){//需要完善，部分不需要汇总信息
					$.ajax({
						type:"POST",
						dataType:"JSON",
						url:BASE_PATH+'/reportController/getDataSummary',
						data:$.extend(getParamValues(pageDefaults.formId),paramsReport),
						success:function(data){
							//alert("汇总返回结果是："+JSON.stringify(data));
							$("#combinationDigger_grid_"+paramsReport['groupId']).datagrid("reloadFooter",data);
						}
					});
				}else{
					$("#combinationDigger_grid_"+paramsReport['groupId']).datagrid("reloadFooter",[]);
				}
				
			}
	};
	paramsReport['columns']=undefined;
	//add 20160503
	if(paramsReport['groupSqlMapping']){
		var sqlRadioId="group_radio"+paramsReport['groupId']+paramsReport['sqlId'];
		var groupSqlMappingArray=paramsReport['groupSqlMapping'].split(",");
		for(var j=0;j<groupSqlMappingArray.length;j++){
			paramsReport[groupSqlMappingArray[j]+"Multi"]=$("#"+sqlRadioId).attr(groupSqlMappingArray[j]+"Multi");
		}
	}
	doSearch(options,paramsReport);
}
/**
 * 加载单据的汇总数据
 */
function loadSummary(paramsReport){
	
}
/**
 * 重新加载数据，并额外传递参数
 * @param params
 * @param datagridId
 */
function datagridReloadData(params,datagridId){
	var datagridId=datagridId || pageDefaults.tableId;
	var queryParams=$("#"+datagridId).datagrid("options").queryParams;
	if(params){
		for(var key in params){
			queryParams[key]=params[key];
		}
	} 
	$('#'+datagridId).datagrid('loadData', {
			total : 0,
			rows : []
		});
	$('#'+datagridId).datagrid({
			queryParams: queryParams
			});
}
//查询js
function doSearch(options,additionParams){
	var beforeSearchFlag=true;
	try{
		beforeSearchFlag=eval('beforeSearch()');
	}catch(e){
		
	}
	if(beforeSearchFlag){
		var defaults={
				'pageNumber':1,
				'pageSize':pageSize,
				'pageList':pageList,
				'pagination':true,
				'fit':true,
				'rownumbers':true,
				'method':'POST',
				'multiColumns':undefined,
				'onLoadError':function(data){
					//alert('后台异常返回信息是：'+JSON.stringify(data));
					if(data.status && data.status == 600){  //权限拦截没有通过，超时登录或已退出登录
						
					}else{
						$.messager.alert('error','查询出现异常，请联系管理员!!');
						$('#'+pageDefaults.tableId).datagrid("loadData",{total:0,rows:[]});
					}
				},
				'onBeforeSortColumn':function(){
							var innerQueryParams=$(this).datagrid("options").queryParams;
							innerQueryParams['multiColumns']=undefined;
							$(this).datagrid("options").queryParams=innerQueryParams;
							 $(this).datagrid("options").pageNumber=1;
							 var pg = $(this).datagrid("getPager").pagination('refresh',{'pageNumber':1});
				}
				
		};
		var searchBegin=(new Date()).getTime();
		var setting=$.extend({},defaults,options);
		$.extend(pageDefaults,options);
		if(additionParams){
			setting["queryParams"]=$.extend(getParamValues(pageDefaults.formId),additionParams);
		}else{
			setting["queryParams"]=getParamValues(pageDefaults.formId);
		}
		$('#'+pageDefaults.tableId).datagrid(setting);
		var searchEnd=(new Date()).getTime();
		console.log('crud查询方法用时ms：'+(searchEnd-searchBegin));
	}
}
//处理表单中参数
function getParamValues(formId){
	var groups=$("#"+formId).find(".form-group");
	var params={};
	for(var i=0;i<groups.length;i++){
		var group =groups[i];
		var elementType="input";
		var groupId=$(group).attr("id");
		if(groupId!=undefined && groupId!=''){
			var groupIds=$(group).attr("id").split("_");
			elementType=groupIds[groupIds.length-1];
		}
		var conditionValue="";
		if(elementType == "input"){
			$(group).find("input").each(function(){
				if($(this).val()){
					params[$(this).attr('id')]=$(this).val();
				}
			});
		}else if (elementType=="select"){
			var combobox=$(group).find(".easyui-combobox");
			var cobValue=combobox.combobox("getValues");
			if(cobValue && "cbb_all"!=cobValue){
				params[combobox.attr("id")]=cobValue.join('_');
				if(cobValue.indexOf('cbb_all')>=0){
					params[combobox.attr("id")]=undefined;
				}
			}
		} else if (elementType == "date"){
			var beginDate=$(group).find(".easyui-datebox").first();
			var endDate=$(group).find(".easyui-datebox").last();
			var beginDateValue=$(beginDate).datebox('getValue');
			var endDateValue=$(endDate).datebox('getValue');
			if(beginDateValue){
				params[beginDate.attr('id')]=beginDateValue;
			}
			if(endDateValue){
				params[endDate.attr('id')]=endDateValue;
			}
		}else if (elementType == "checkbox"){
			var cb_value_array=new Array();
			var checkeds=$(group).find(":checked").each(function(){
				cb_value_array.push($(this).val());
				}
			);
			if(cb_value_array.length>0){
				params[$(group).find(":checked").attr('name')]=cb_value_array.join('-');
			}
		}else if (elementType == "chooseInput"){
			var hiddenElement=$(group).find("input").first();
			if(hiddenElement.val()){
				params[hiddenElement.attr("id")]=hiddenElement.val();
			}
		}else if (elementType=="tree"){
			var elementId=$(group).find("input").first().attr("id");
			var values=$("#"+elementId).combotree("getValues");
			var texts=$("#"+elementId).combotree("getText");
			if(values && values.length>0 && values[0] ){
				params[elementId]=values.join("_");
			}
		}
	}
	var result={};
	for(key in params){
		if(key.indexOf("search_")==0){
			result[key.substring("search_".length)]=jQuery.trim(params[key]);
		}else{
			result[key]=jQuery.trim(params[key]);
		}
	}
	return result;
}
/********************************** 查询js重构结束      ****************************************************/
function paramValue(sfm) { 
    var b = $("#" + sfm + " input");
    var param = '';//alert(b.length);
    for (var i = 0; i < b.length; i++) {
        var bname = b[i].id;
        if (bname == null || bname == '') {
            bname = b[i].name;
        }
        if (bname != null && bname != '') {
            var sb = bname.split('search_');
            if (sb.length <= 1) {
                continue;
            }
            if (b[i].style.display == 'none') {
                try {
                    var arr = b[i].parentNode.childNodes[2].childNodes[2];
                    if (arr.type == 'hidden') {
                        param += ',\"' + sb[1] + '\":\"' + arr.value + '\"';
                    }
                } catch (e) {
                }
            } else if (b[i].type == 'text' || b[i].type == 'hidden') {
            	if("cbb_all"==b[i].value){
            		param += ',\"' + sb[1] + '\":\" \"';
            	}else{
            		param += ',\"' + sb[1] + '\":\"' + b[i].value + '\"';
            	}
                
            } else if (b[i].type == 'radio' || b[i].type == 'radio') {
                if (b[i].checked)
                    param += ',\"' + sb[1] + '\":\"' + b[i].value + '\"';
            } else if (b[i].type == 'checkbox' || b[i].type == 'checkbox') {
                if (b[i].checked)
                    param += ',\"' + sb[1] + '\":\"' + b[i].value + '\"';
            } else if (b[i].class.indexOf("easyui-datebox")>0) {
                param += ',\"' + sb[1] + '\":\"' + $(b[i]).datebox("getValue") + '\"';
            }
        }
    }
    var s = $("#" + sfm + ">select");
    for (var i = 0; i < s.length; i++) {
        var sname = s[i].id;
        alert(sname);
        if (sname == null || sname == '') {
            sname = s[i].name;
        }
        if (sname != null && sname != '') {
            var ssb = sname.split('search_');
            if (ssb.length > 1) {
                param += ',\"' + ssb[1] + '\":\"' + s[i].value + '\"';
            }
        }
    }

    return eval('({' + param.substring(1, param.length) + '})');
}

var Curd = {
    //表单查询
    formSearch: function (gridId, params) {
        //var queryParams=toJsonObject(paramsArray);
        var queryParams = params;
        var $grid = $("#" + gridId);
        $grid.datagrid('options').queryParams = queryParams;
        $grid.datagrid('reload');
    },
    //简单查询
    simpleSearch: function (gridId, value, name) {
        var arr = new Array(
            new Array(name, value));
        var params = toJsonObject(arr);
        var queryParams = params;
        var $grid = $("#" + gridId);
        $grid.datagrid('options').queryParams = queryParams;
        $grid.datagrid('reload');
    },
    //重置表单
    resetSearch: function (searchFormId) {
        document.getElementById(searchFormId).reset();
    }
}


/********************  勿删  **********************/
function newinsert(dlg, fm, title) {
    $('#' + dlg).dialog('open').dialog('setTitle', title);
    if (arguments.length > 3) {
        $('#' + fm).form('clear');
        $('#' + fm).form('load', arguments[3]);
    } else {
        $('#' + fm).form('clear');
    }
}
function newshow(dlg, fm, table, title) {
    var rows = $('#' + table).datagrid('getSelections');
    if (rows == null || rows == '' || rows.length == 0) {
        jQuery.messager.alert('提示:', '请选择操作记录!');
        return;
    }
    if (rows.length > 1) {
        jQuery.messager.alert('提示:', '只能操作一条记录!');
        return;
    }
    var row = $('#' + table).datagrid('getSelected');
    if (row) {
        $('#' + dlg).dialog('open').dialog('setTitle', title);
        $('#' + fm).form('load', row);
    }
}
function newedit(dlg, fm, table, title) {
    var rows = $('#' + table).datagrid('getSelections');
    if (rows == null || rows == '' || rows.length == 0) {
        jQuery.messager.alert('提示:', '请选择操作记录!');
        return;
    }
    if (rows.length > 1) {
        jQuery.messager.alert('提示:', '只能操作一条记录!');
        return;
    }
    var row = $('#' + table).datagrid('getSelected');
    if (row) {
        $('#' + dlg).dialog('open').dialog('setTitle', title);
        $('#' + fm).form('load', row);
    }
}
function newsave(dlg, fm, table, url) {
    var args = arguments;
    $('#' + fm).form('submit', {
        url: url,
        onSubmit: function () {
            return $(this).form('validate');
        },
        success: function (msg) {
            //alert(results);
            /*	var result = eval('(' + results + ')');
             if (result.success) {
             $('#'+table).datagrid('reload');
             $.messager.show({
             title : '提示',
             msg : result.msg
             });
             $('#'+dlg).dialog('close');
             } else {
             $('#'+dlg).dialog('close'); // close the dialog
             $('#'+table).datagrid('reload'); // reload the user data
             }*/
            if (args.length > 5 && args[5] == 'tree') {
                doMessage(msg, table, dlg, args[4], args[5]);
            } else if (args.length > 4) {
                doMessage(msg, table, dlg, args[4]);
            } else {
                doMessage(msg, table, dlg);
            }

        }
    });
}
function newremove(table, url, keyid) {
    var row = $('#' + table).datagrid('getSelected');
    if (row == null || row == '' || row.length == 0) {
        jQuery.messager.alert('提示:', '请选择操作记录!');
        return;
    }
    if (row) {
        $.messager.confirm('提示', '是否确定删除?', function (r) {
            if (r) {
                var rows = $('#' + table).datagrid('getSelections');
                var ids = '';
                for (var i = 0; i < rows.length; i++) {
                    var row = rows[i];
                    if (i != 0) {
                        ids += ',';
                    }
                    ids += row[keyid];
                }
                deleterow(table, url, ids, null);
            }
        });
    }
}

function treegridremove(table, url, keyid) {
    var args = arguments;
    var row = $('#' + table).treegrid('getSelected');
    if (row == null || row == '' || row.length == 0) {
        jQuery.messager.alert('提示:', '请选择操作记录!');
        return;
    }
    if (row) {
        $.messager.confirm('提示', '是否确定删除?', function (r) {
            if (r) {
                var rows = $('#' + table).treegrid('getSelections');
                var ids = '';
                for (var i = 0; i < rows.length; i++) {
                    var row = rows[i];
                    if (i != 0) {
                        ids += ',';
                    }
                    ids += row[keyid];
                }
                if (args.length > 3) {
                    deleterow(table, url, ids, 'tree', args[3]);
                } else {
                    deleterow(table, url, ids, 'tree');
                }

            }
        });
    }
}

function deleterow(table, url, ids, type) {
    var args = arguments;
    $.ajax({
        type: "POST",
        url: url,
        data: "pkId=" + ids,
        success: function (msg) {
            doMessage(msg, table, null, null, type);
            if (args.length > 3) {
                eval("var _function = " + args[3]);
                _function();
            }
        }
    });
}

/**
 * 系统消息
 * */
function doMessage(msg, table, dlg) {

    var result = eval('(' + msg + ')');
    if (result.success == 'true' || result.success == true) {
        if (arguments.length > 4 && arguments[4] == 'tree') {
            $('#' + table).treegrid('reload');
        } else {
            $('#' + table).datagrid('reload');
        }
        $.messager.show({
            title: '提示',
            msg: result.msg
        });
        if (arguments.length > 3) {
            eval("var _function = " + arguments[3]);
            _function();
        }
        if (dlg != null && '' != dlg) {
            $('#' + dlg).dialog('close');
        }

    } else {
        jQuery.messager.alert('提示:', result.msg);
    }
}


/***************** datagrid 列表数据样式设置js **********************/
var oasis_style = {
		setFormatter: function(tableName, fields, formatter) {
			var columnOption = null;
			for(var i = 0 ; i < fields.length ; i ++) {
				columnOption = $('#' + tableName).datagrid('getColumnOption', fields[i]);
				if(columnOption != null) {
					columnOption.formatter = formatter;
				}				
			}
		},
		setCellStyler:function(tableName, fields, cellStyler){
			var columnOption = null;
			for(var i = 0 ; i < fields.length ; i ++) {
				columnOption = $('#' + tableName).datagrid('getColumnOption', fields[i]);
				if(columnOption != null) {
					columnOption.styler = cellStyler;
				}				
			}
		},
		setTwoDecimal: function(tableName, fields, formatter) {
			var columnOption = null;
			for(var i = 0 ; i < fields.length ; i ++) {
				columnOption = $('#' + tableName).datagrid('getColumnOption', fields[i]);
				if(columnOption != null) {
					columnOption.formatter = formatter;
				}				
			}
		},
		setAlign: function(tableName, fields, align) {
			var columnOption = null;
			var $panel = $('#'+tableName).datagrid("getPanel");
			for(var i = 0 ; i < fields.length ; i ++) {
				columnOption = $('#' + tableName).datagrid('getColumnOption', fields[i]);
				var ths = $($panel).find("td[field='"+fields[i]+"']");
				$(ths[0]).css("text-align",align);
				if(columnOption != null) {
					columnOption.align = align;
				}	
			}
		},
		setWidth: function(tableName, fields, width) {
			var columnOption = null;
			var $panel = $('#'+tableName).datagrid("getPanel");
			for(var i = 0 ; i < fields.length ; i ++) {
				columnOption = $('#' + tableName).datagrid('getColumnOption', fields[i]);
				var ths = $($panel).find("td[field='"+fields[i]+"']");
				$(ths[0]).css("width",width);
				if(columnOption != null) {
					columnOption.width = width;
				}	
			}
		},
		width: function(num, minWidth) {
			var width = (($(window).width()) * num);
			console.log("num is: " + num + "--minwidth is: " + minWidth + "--width is: " + width);
			return width >= Number(minWidth) ? width : Number(minWidth);
		},

		/*
		 * 金额格式化formater，如果money为空，则不处理
		 */
		moneyLabel: function (money, position) {
			var isMaster = false;
			if (position && position == 'master') {
				isMaster = true;
			}
			money = Number(money);
			if (!isMaster) {
				if (money) {
					return "<label style='font-family:Arial;margin-bottom: 3px;display: inline;'>&yen</label>" + milliFormat(money.toFixed(2));
				} else if(money == '0') {
					return "<label style='font-family:Arial;margin-bottom: 3px;display: inline;'>&yen</label>0.00";
				}
				return '';
			} else {
				if (money) {
					return "<lab  style='width:auto;'><span><lab style='font-family:Arial;text-align:left;width:auto;padding-top:0px;'>&yen</lab>" + milliFormat(money.toFixed(2)) + "</span></lab>";
				} else if(money == '0') {
					return "<lab><span><lab style='font-family:Arial;text-align:left;width:auto;padding-top:0px;'>&yen</lab>0.00</span></lab>";
				}
				return '';
			}
		},
		quantityLabel: function(numberText){
			return milliFormat(numberText);
		},
		percentageLabel:function (percentage, position) {
			percentage = Number(percentage);
			if(percentage){
				return Number(percentage)+"%";
			}else{
				if(percentage==0){
					return '0.00%';
				}
				return '';
			}
		},
		productNameStyle:'#1331D7;cursor:pointer'
};

/**
 * 数字添加千位符（2015-11-27 xuzhen 方法名由number2Money改为milliFormat）
 * @param numberText
 * @returns {String}
 */
function milliFormat(numberText) {
    if (isNull(numberText))
        return;
    var ms2 = numberText+"";
    var ms3 = '';
    if (ms2.indexOf('-') == 0 && ms2.length > 1) {
        ms3 = '-';
    }
    var moneyArray = (numberText+"").split(".");
    var ms = moneyArray[0].replace(/[^\d\.]/g, "").replace(/(\.\d{2}).+$/, "$1").replace(/^0+([1-9])/, "$1").replace(/^0+$/, "0");
    var txt = ms.split(".");
    while (/\d{4}(,|$)/.test(txt[0]))
        txt[0] = txt[0].replace(/(\d)(\d{3}(,|$))/, "$1,$2");
    if (txt[0].length > 16) {
        alert("数值超出范围！支持的最大数值为 999999999999.99");
    }
    return ms3 + txt[0] + (moneyArray.length > 1 ? "." + moneyArray[1] : "");
}

/*
 * 金额格式化，如果money为空，则不处理 (input框使用)
 */
function moneyFormat(money, position) {
	var isMaster = false;
	if (position && position == 'master') {
		isMaster = true;
	}
	money = Number(money);
	if (!isMaster) {
		if (money) {
			return "￥" + milliFormat(money.toFixed(2));
		} else if(money == '0') {
			return "￥0.00";
		}
		return '';
	} else {
		if (money) {
			return "￥" + milliFormat(money.toFixed(2));
		} else if(money == '0') {
			return "￥0.00";
		}
		return '';
	}
}

